package com.rp.article.html.controller;


import com.rp.article.html.config.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RabbitMQConsumer {

    @RabbitListener(queues = {RabbitMQConfig.QUEUE_DOWNLOAD_HTML})
    public void consumer(String payload, Message message){
      log.info("--------->{}",payload);

        String receivedRoutingKey = message.getMessageProperties().getReceivedRoutingKey();
        log.info("====>{}", receivedRoutingKey);

    }
}
